﻿using System.Collections.Generic;

namespace XmlServer.ServiceContracts
{

    /// <summary>
    /// Implemented by an operator class (such as EchoOperator).  The operator is invoked 
    /// by the XmlServer
    /// </summary>
    public interface IOperator
    {

        /// <summary>
        /// get/set the name of the operator
        /// </summary>
        string Name { get; }

        /// <summary>
        /// get/set the version number of the operator
        /// </summary>
        string Version { get; }

        /// <summary>
        /// get/set the full name of the operator = {Name}_{Version}
        /// </summary>
        string FullName { get; }

        /// <summary>
        /// get/set the description of the operator
        /// </summary>
        string Description { get; }


        /// <summary>
        /// An operator can return the list of requried and optional facts (with descriptions) that it requires
        /// </summary>
        List<IFact> Facts { get; }

        /// <summary>
        /// ProcessRequest() is called by the XmlServer.  The implementation of the operator should be programmed
        /// in this methods.
        /// </summary>
        /// <param name="request">The request from the client; This includes the collection of facts</param>
        /// <returns>IResponse object</returns>
        IResponse ProcessRequest(IRequest request);

    }
}
